package com.example.springboot01.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : com.example.springboot01.controller.HelloController
 * @Description : 类描述
 * Created by cyd on 2020-11-29 16:33:59
 */
@RestController
@RequestMapping(value = "/helloController")
public class HelloController {

    @Value("${person.name}")
    String name;

    @GetMapping("/hello")
    @ResponseBody
    public String test() {
        return "hello world";
    }

    @GetMapping("/sayHello")
    public String sayHello() {
        return "hello to " + name;
    }
}
